package cn.yunhe.dplayerdemo3.Service.impl;

import cn.yunhe.dplayerdemo3.Service.IVideoService;
import cn.yunhe.dplayerdemo3.entity.Video;
import cn.yunhe.dplayerdemo3.mapper.IVideoMapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class VideoService extends ServiceImpl<IVideoMapper, Video> implements IVideoService {

    @Autowired
    private IVideoMapper videoMapper;


    @Override
    public Video getVideoByName(int id) {
        return videoMapper.getVideoByName(id);
    }

    @Override
    public boolean delLike(int id) {
        int num = videoMapper.delLike(id);
        if(num>0){
            return true;
        }else{
            return false;
        }
    }

    @Override
    public boolean addLike(int id) {
        int num = videoMapper.addLike(id);
        if(num>0){
            return true;
        }else{
            return false;
        }
    }
}
